import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/tabbar/Home.vue";
import Cart from "../views/tabbar/Cart.vue";
import Mine from "../views/tabbar/Mine.vue";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    component: Home,
    meta: {
      title: "首页",
    },
  },
  {
    path: "/cart",
    component: Cart,
    meta: {
      title: "购物车",
    },
  },
  {
    path: "/mine",
    component:Mine ,
    meta: {
      title: "我的",
    },
  },
  {
    path: "/jfgz",
    component: () => import('../views/pages/Jfgz.vue'),
    meta: {
      title: "积分规则",
    },
  },
  {
    path: "/ptjs",
    component: () => import('../views/pages/Ptjs.vue'),
    meta: {
      title: "平台介绍",
    },
  },
  {
    path: "/gdxx",
    component: () => import('../views/pages/MoreNews.vue'),
    meta: {
      title: "教师发展中心",
    },
  },
  {
    path: "/details:id",
    component: () => import('../views/pages/Details.vue'),
    meta: {
      title: "教师发展中心",
    },
  },
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
];

const router = new VueRouter({
  mode: "history",
  routes,
});

export default router;
